package net.zabuchy.activities.action;
 
import java.util.HashSet;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import net.zabuchy.activities.entity.HistoryAttribute;
import net.zabuchy.helper.ParamNames;

import com.opensymphony.xwork2.Action;
 
public class EnterCommentAction extends ActivityAction implements 
		ServletRequestAware,ServletResponseAware {
 
    private static final Logger LOGGER = Logger.getLogger(EnterCommentAction.class.getName());
 
    private HttpServletRequest request;
    private HttpServletResponse response;
    
    private int issueId;
    
    public int getIssueId() {
		return issueId;
	}

	public void setIssueId(int issueId) {
		this.issueId = issueId;
	}

	public String execute() {
    	LOGGER.debug("AddComment : issueId " + issueId);
    	Set<HistoryAttribute> attributes = new HashSet<HistoryAttribute>(0);
    	saveActivityEvent(issueId, attributes, ParamNames.COMMENT);
    	
    	return Action.SUCCESS;
    }
    
	public void setServletRequest(HttpServletRequest request){
		  this.request = request;
		  }

		  public HttpServletRequest getServletRequest(){
		  return request;
		  }

		  public void setServletResponse(HttpServletResponse response){
		  this.response = response;
		  }

		  public HttpServletResponse getServletResponse(){
		  return response;
		  }

	
}




